import request from '@/utils/request'

// 创建操作票
export function createOperationTicket(data) {
  return request({
    url: '/biz/operation-ticket/create',
    method: 'post',
    data: data
  })
}

// 更新操作票
export function updateOperationTicket(data) {
  return request({
    url: '/biz/operation-ticket/update',
    method: 'put',
    data: data
  })
}

// 删除操作票
export function deleteOperationTicket(id) {
  return request({
    url: '/biz/operation-ticket/delete?id=' + id,
    method: 'delete'
  })
}

// 获得操作票
export function getOperationTicket(id) {
  return request({
    url: '/biz/operation-ticket/get?id=' + id,
    method: 'get'
  })
}

// 获得操作票分页
export function getOperationTicketPage(query) {
  return request({
    url: '/biz/operation-ticket/page',
    method: 'get',
    params: query
  })
}

// 导出操作票 Excel
export function exportOperationTicketExcel(query) {
  return request({
    url: '/biz/operation-ticket/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
